import http from '../util/request.js'
export default {
    captcha:()=>{
        return http({
            url: '/api/login/captcha',
            method: 'get',
            //表单参数
        });
    },
    login: (obj)=> {
        return http({
            url: '/api/login/dologin',
            method: 'post',
            params: obj//表单参数
        });
    },
    getlogin: (obj)=> {
        return http({
            url: '/api/login/getlogin',
            method: 'get',
            params: obj//表单参数
        });
    },
    // 新增：发送重置密码验证码
    sendResetCaptcha: (user_name) => {
        return http({
            url: '/api/login/sendResetCaptcha',
            method: 'get',
            params: { user_name }
        });
    },

    // 新增：确认重置密码
    confirmReset: (obj) => {
        return http({
            url: '/api/login/confirmReset',
            method: 'post',
            data: obj
        });
    },
    // 发送注册验证码（新增）
    sendRegisterCaptcha: (userName, email) => {
        return http({
            url: '/api/login/sendRegisterCaptcha',
            method: 'get',
            params: { user_name: userName, email }
        });
    },

    // 用户注册（新增）
    register: (obj) => {
        return http({
            url: '/api/login/register',
            method: 'post',
            data: obj
        });
    }
}
